package com.ryder.petmatediarybackend.module.user.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

/**
 * 描述：修改密码 DTO
 *
 * @author Ryder
 * @version 1.0
 * @since 1.0
 * 更新日期: 2025-10-31
 */
@Data
@Schema(description = "修改密码DTO")
public class ChangePasswordDTO {

    @Schema(description = "旧密码", example = "ABC123.", required = true)
    @NotBlank(message = "旧密码不能为空")
    private String oldPassword;

    @Schema(description = "新密码", example = "NewPass456.", required = true)
    @NotBlank(message = "新密码不能为空")
    @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&.])[A-Za-z\\d@$!%*#?&.]{6,20}$",
            message = "密码必须包含字母、数字和特殊字符，长度6-20位")
    private String newPassword;

    @Schema(description = "确认新密码", example = "NewPass456.", required = true)
    @NotBlank(message = "确认密码不能为空")
    private String confirmPassword;
}

